package com.wx.gof.pattern.structural.composite.interfacetype;

import java.math.BigDecimal;
import java.util.List;

/**
 * @ClassName Book
 * @Author wx
 * @Description 书
 * @Date 2018-12-09-20:38
 */
public class Book implements IBook {
    private String bookName;
    private String author;
    private BigDecimal price;
    private IBookCatalog bookCatalog;

    public Book(String bookName, String author, BigDecimal price) {
        this.bookName = bookName;
        this.author = author;
        this.price = price;
    }

    @Override
    public BigDecimal getPrice() {
        return this.price;
    }

    @Override
    public String getAuthor() {
        return this.author;
    }

    @Override
    public void setBookCatalog(IBookCatalog bookCatalog) {
        this.bookCatalog = bookCatalog;
    }


    @Override
    public String getName() {
        return this.bookName;
    }

    @Override
    public void printContent() {
        System.out.println("书名:" + this.bookName + "/价格:" + this.price + "/作者" + this.author);
/*        System.out.println("目录");
        bookCatalog.printContent();*/

    }

}
